/**
 * Copyright (c) 快宝网络 kuaidihelp.com Co., Ltd. All Rights Reserved 禁止外泄以及用于其它的商业用途
 */

import React, { Component } from "react";
import { connect } from "dva";
import PageHeaderLayout from "@/layouts/PageHeaderLayout";
import StandardTab from "@/components/StandardTab";
import OrderRecord from "../components/OrderRecord";
import OrderStatistics from "../components/OrderStatistics";
import styles from "../commen.less";

@connect()
class Index extends Component {
  constructor(props) {
    super(props);
    this.state = {
      activeKey: "record",
    };
  }

  onChange = activeKey => {
    this.setState({
      activeKey,
    });
  };

  render() {
    const { activeKey } = this.state;
    const panes = [
      {
        tab: "单号记录",
        key: "record",
        component: <OrderRecord sourceType="yz" activeKey={activeKey} />,
      },
      {
        tab: "单号使用统计",
        key: "statistics",
        component: <OrderStatistics sourceType="yz" activeKey={activeKey} />,
      },
    ];
    return (
      <PageHeaderLayout title="单号记录">
        <div className={styles.main}>
          <StandardTab onChange={this.onChange} activeKey={activeKey} panes={panes} name="record" />
        </div>
      </PageHeaderLayout>
    );
  }
}

export default Index;
